<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProfitsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('profits', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->comment('用户ID');
            $table->unsignedDecimal('freeze', 20, 8)->comment('待释放USDT');
            $table->unsignedDecimal('rate', 20, 4)->comment('释放比例');
            $table->unsignedDecimal('profit', 20, 8)->comment('释放数量');
            $table->timestamp('time')->nullable()->useCurrent()->comment('时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('profits');
    }
}
